package com.example.design.patterns.冰河.行为模式.责任链模式;

import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.AddMoneyRequest;
import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.DimissionRequest;
import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.HRRequestHandle;
import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.LeaveRequest;
import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.PMRequestHandle;
import com.example.design.patterns.冰河.行为模式.责任链模式.concreteHandler.TLRequestHandle;
import com.example.design.patterns.冰河.行为模式.责任链模式.handler.Request;

public class Test {
    public static void main(String[] args) {
        HRRequestHandle hr = new HRRequestHandle();
        PMRequestHandle pm = new PMRequestHandle(hr);
        TLRequestHandle tl = new TLRequestHandle(pm);

        // team leader 处理离职请求

        Request request = new LeaveRequest();
        tl.handleRequest(request);
        System.out.println("-----------------------");
        // team leader 处理加薪请求
        request = new AddMoneyRequest();
        tl.handleRequest(request);
        System.out.println("-------------------------");
        // team leader 处理辞职请求
        request = new DimissionRequest();
        pm.handleRequest(request);
    }
}
